Home:ALL Converter>Flutter build is iOs - Error (Xcode): Undefined symbol: _objc_msgSend$

Flutter build is iOs - Error (Xcode): Undefined symbol: _objc_msgSend$

Ask Time:2022-10-08T04:33:19         Author:Bertrand Gélinas

Json Formatter

Trying for several days to build my flutter project in iOs (flutter build IPA) and I always seem to receive the same errors :

     "_objc_msgSend$setIOSHasWarnedLocationServicesOff:", referenced from:
      +[LocationAuthorization run:onCancel:] in TSLocationManager(LocationAuthorization.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

There are a lot of them so I won't be putting all of them here but they're all related to _objc_msgSend$ and TSLocationManager.

I tried to add "-lc++" to Other Linker Flags in Build Settings (Runner Target)., related to this issue https://github.com/facebookarchive/pop/issues/25 but it still failing with more than 100 _objc_msgSend$ issues. I have frankly tried so many things and I'm quite out of clues.

Something I remarked is that when I build from Xcode (Product -» Build), it builds fine when I choose the Destination Device iPhone SE 3rd GEN, but I get the errors when the destination device into my physical device (which is plugged into my Mac).

When I hit flutter build IPA, it always fails.

Author:Bertrand Gélinas,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73992337/flutter-build-is-ios-error-xcode-undefined-symbol-objc-msgsend
jackson :

^_^\nFirst you can update your xcode to version14.0 above.\nAnd the real reason is Apple Clang new optimization scheme._objc_msgSend stup support is not support on xcode13.\nIf you don't want upgrade your xcode version . You can follow next steps to change your private framework.\nI guess you compiled a framework in xcode14 and then used it in xcode13\nhh , now i saw you reply , make sure my answer\ni'm using Xcode 13.4.1 and it's not having ARCHS_VALID as a build setting @editix – \nBertrand Gélinas\n 22 hours ago \n\nBy default, the clang in Xcode 14 will generate target files that cannot be understood by earlier native linkers.\nIn the future, it will be recommended to use Xcode14 and above for application package.\nIf you have private framework build by Xcode14.\n\nJust add -fno-objc-msgsend-selector-stubs to your framework project target build settings other c flags, and build again, replace new framework to your other xcode project\n\nor in your framework project chaneg your podspec file add xcconfig other c flags -fno-objc-msgsend-selector-stubs\n\nor your own script build framework , you can before call xcodebuild command add a change , like thisxcodebuild -project xxx.xcodeproj build OTHER_CFLAGS="-fno-objc-msgsend-selector-stubs "\n\n",
2022-10-13T11:23:28
yy